package top.minuy.structure.graph.search.depth.dfs;

import top.minuy.res.graph.GraphRes;
import top.minuy.structure.graph.representations.table.Graph;

/**
 * 测试图的深度优先遍历的相关例子
 *
 * @author Minuy
 * @time 11:39
 * @date 2021/11/16
 */
public class Test {
    public static void main(String[] args) {
        System.out.println("图的遍历：");
        Graph graph = new Graph(GraphRes.G_DFS_1);

        GraphDFSV1 graphDFSV1 = new GraphDFSV1(graph);
        System.out.println("遍历V1：" + graphDFSV1.order());

        GraphDFSV2 graphDFSV2 = new GraphDFSV2(graph);
        System.out.println("遍历V2：" + graphDFSV2.order());

        GraphDFSV3 graphDFSV3 = new GraphDFSV3(graph);
        System.out.println("先序遍历：" + graphDFSV3.pre());
        System.out.println("后序遍历：" + graphDFSV3.post());
    }
}
